<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>

  <body>
    <script>
      let obj = {
        uname: '刘德华',
        //方法
        song: function (x, y) {
          console.log(x + y)
          return x + y
        },
        dance: function () {},
      }

      //方法调用  对象名.方法
      obj.song(1, 2)

      //若方法里面没有加 return , 则这个打印 undefined
      console.log(obj.song(3, 3))

      //document.write('123')
    </script>
  </body>
</html>
